package com.alipay.config;


import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {
	
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id = "2021000117650702";
	
	// 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCMvAo80RIrk96tG44FYSQdePluwxrxjZxYajl4qoWNrhohFKi64CyhR4nEPp7torp4CtFHB4asLPaTd1cAJKrXLHOCiFDPPJXc0qrS5d7XCXfPaukOaim+tHOFwqftPpGggaqFjxVFHv97+j1vy8tJ1bWwKLvpyvniHmxHdi14mHZUO+W20vvO8vDZdCDQ9ZHimDW6GMl1GTN6BSQuSAX8vq78kQRs+iCWjWGNsIQEIQSWhxJ9HYfkqQDNr00DVccAgxzrDKIYahUZWcdpRnGuKC0H6YlMIRBjzMNhdSAOP2uiHd2iQiWf5M7VvnLNfy8rULoIqD3zYZ5+l52xLs6TAgMBAAECggEAWMjUaJO5M9bAt1LX4Rrsjs9gBPl/SP5+sOSqxy5EvSImB9Khs+tzHHgmOLEM0HxFyS+B4Z6k3oArOtMiBswbH05CvQnEeUkOflZFQHGWiPDHLgqTZu2g0lfDPZKVID3F342OB15CG+43XX58PchCwpzZV34LNq4/wOBSjS7H9vjAb740bRvkQMwYcx1vc79LzPysd0Dru6vyCYLVkI8NTo3gl3YE/01qmyTjQ+7OUvJaMV9psWMIQh/9OusUQbX/JZ/gc8WB6u8dUoYpiZpNwlFAoB2tQ794fPJcD49niQIZsFZMZpxMLTDcNoVpshtfjF74+2/lTZ7PlHmvMR7aYQKBgQDIPtXhjPFOSggMcYIPUrhY73CsbYPvJBfw2e3Dm/O+KNoUUBTOOA54LRvvFkz3bqKqKMeuQQ8htti6mHTjybBVf4A62yp6Q8FYAp7vlevjueJhHeCM300WOFjsy34ZtucUSoGo5orqJM8/nwbdm7/M5hxz6A5lWNPzOS+eJNf9MQKBgQCz611VlXZNtY7klZRx3gvjlOsh69nK2hGQqGUzlfKWUUHaEDZ25yFg5KNrKtbVLAZBlsIj6lhB02+/gYDHntfupICk7SdjVl1iAOHWsacZ++6MWM32o6ui3N36X/nKuuyDSfap445ACPG/70WyFpcFiyMp7vygIZ1Lv5mMDcKHAwKBgHwY7OXOOhGBscE8axTh99st8I77g+MlZCzgcghi0siLerNR+cLfXKA/nGssT+Cb0PVRNoaYTS9gqKnjJ7WvXbduv+I5xvZknSLU5Pin2buUjGYRZQMItDZMD1gYuHppLoYVsosg7QA0dbgA7vlRt6jdBs8SBjHqvdejHg6M2MpRAoGACr1Z7OnnDexwgySKn+FpRER3ZKb3cSxjMAddQx8IRADFtYaSObbCP05mktcTy9W86d1d6VbrvcIpQX0xerj4mr4nD7E4UK2vFVKIKJCiMOLg8m+6m6ZZcHdOqMth1cAirhOULb/vldLy20olFuRST3pmtvIVElnvUb42JC4OFpECgYBtlXLvYLfhX9pCislRDtIZLhv2Uug+mQ1adih+zXIxnDWOD4kh6u0de2G+KoREbA58IsXy3JAsr/D+V7TlucC6g/y650uF68dHvqVt1XIcYS0DGGFSlRi6RAN3SM40aWSmRNJ7kxWUMMJzlyeWzfPYwzYXY6u/NlygnlxUyrVn4g==";
	
	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAgQFDWxzwvtygWv4lvCNc0BipNNirCQCGgM9XrIeQ5iyAKqy1rmuvjokL+y4FyXAPdZZ5gl74LEtPyaVYh8nkZo194smI8AlAsgTgaiKlco/uuhzVbbpuCqXHmDNaI8VjQlR97SDEeTtt2HkWR1LQILyh3xKyiQDxe2kUSFu8avtus9gnJ3WvBVgBZW77i4iLOArcEAQqwGgDwSfCoqwzokADwvsxAtiz/PQyu172Xc6OqjKDojni5DRVb97P/7zkWl5G3myra0vDH5AN8M8TpU4EbAEAVchM3F0V5i9s6bz2WDxi/oUDjz+plNby5zqy6QvIcuq7vmHMprODO1h09QIDAQAB";

	// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url = "http://工程公网访问地址/alipay.trade.page.pay-JAVA-UTF-8/notify_url.jsp";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	//public static String return_url = "http://工程公网访问地址/alipay.trade.page.pay-JAVA-UTF-8/return_url.jsp";

        public static String return_url = "http://localhost:8084/P04_About_Picture_Uploading/";

	// 签名方式
	public static String sign_type = "RSA2";
	
	// 字符编码格式
	public static String charset = "utf-8";
	
	// 支付宝网关
	public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";
	
	// 支付宝网关
	public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /** 
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

